package com.medicine.hbp.adapter.self;

import org.kymjs.kjframe.KJBitmap;
import org.kymjs.kjframe.widget.RoundImageView;

import com.medicine.hbp.base.MyBaseAdapter;
import com.medicine.hbp.mob.ArtInfoVo;
import com.medicine.hbp.mob.FansInfoVo;
import com.medicine.hbp.mob.artGroupVo;
import com.medicine.hbp.mob.laberInfoVo;
import com.medicine.hbp.ui.SelfUserTwoActivity;
import com.medicine.hbp.xListView.XListView;
import com.medicine.hbp.R;

import android.app.Activity;
import android.content.Intent;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.AbsListView;
import android.widget.AbsListView.OnScrollListener;
import android.widget.ImageView;
import android.widget.TextView;

public class FragmentUserAdapter05 extends MyBaseAdapter {
	private LayoutInflater inflater;
	private KJBitmap bitmap=new KJBitmap();

	public FragmentUserAdapter05(Activity activity) {
		this.activity=activity;
		inflater = LayoutInflater.from(activity);
	}

	@Override
	public View getView(int position, View view, ViewGroup arg2) {
		viewHolder holder = null;
		if (view == null) {
			holder = new viewHolder();
			view = inflater.inflate(R.layout.item_fragment_user_05, arg2,false);
			holder.text_name = (TextView) view.findViewById(R.id.txt_name);
			holder.txt_qm = (TextView) view.findViewById(R.id.txt_qm);
			holder.img_userhead = (RoundImageView) view.findViewById(R.id.img_userhead);
			view.setTag(holder);
		} else {
			holder = (viewHolder) view.getTag();
		}
		final FansInfoVo Vo = (FansInfoVo) getItem(position);
		if (Vo != null) {
			if(!TextUtils.isEmpty(Vo.userHeadImg)){
				bitmap.display(holder.img_userhead, Vo.userHeadImg);
			}
			holder.text_name.setText(Vo.userName);
			holder.txt_qm.setText(Vo.userSignature);

			view.setOnClickListener(new OnClickListener() {
				@Override
				public void onClick(View arg0) {
					Intent intent=new Intent(activity,SelfUserTwoActivity.class);
					intent.putExtra("userId", Vo.userId);
					activity.startActivity(intent);

				}
			});
//			holder.text_b_num.setText(Vo.artViewNumber);
//			if(Vo.artImg.size()>0){
//				bitmap.display(	holder.img_bq, Vo.artImg.get(0).artImgUrl);
//			}
		}
		return view;
	}

	class viewHolder {
		TextView text_name;// 标题
		TextView txt_qm;// 时间
		RoundImageView img_userhead;//图片
	}

}
